home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / linux / howto / ethernet / part2 < prev   
Internet Message Format  |  1994-03-15  |  52KB

  1. Path: bloom-beacon.mit.edu!hookup!swrinde!emory!news-feed-2.peachnet.edu!concert!bigblue.oit.unc.edu!sunSITE!mdw
  2. From: Paul Gortmaker <gpg109@rsphysse.anu.edu.au>
  3. Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers
  4. Subject: Linux Ethernet HOWTO (Part 2/2)
  5. Followup-To: poster
  6. Date: 16 Mar 1994 05:27:09 GMT
  7. Organization: The University of North Carolina at Chapel Hill
  8. Lines: 1178
  9. Approved: linux-announce@tc.cornell.edu (Matt Welsh)
  10. Message-ID: <2m65bd$e14@bigblue.oit.unc.edu>
  11. NNTP-Posting-Host: calzone.oit.unc.edu
  12. Keywords: Linux, Ethernet, TCP/IP, NET-2, network
  13. Originator: mdw@sunSITE
  14. Xref: bloom-beacon.mit.edu comp.os.linux.announce:1952 comp.os.linux.admin:5613 comp.answers:4182 news.answers:16451
  15.  
  16. Archive-Name: linux/howto/ethernet/part2
  17. Last-Modified: 16 Mar 1994
  18.  
  19. [This is part 2/2 of the Ethernet-HOWTO.]
  20.  
  21. 5 Technical information.
  22.  
  23.     For those who want to play with the present drivers, or try to make
  24.     up their own driver for a card that is presently unsupported, this
  25.     information should be useful. If you do not fall into this category,
  26.     then perhaps you will want to skip this section.
  27.  
  28. 5.01 Probed addresses
  29.  
  30.     While trying to determine what ethernet card is there, the following
  31.     addresses are autoprobed, assuming the type and specs of the card
  32.     have not been set in the kernel. As of 0.99pl12, doing a "make config"
  33.     will ask what cards are to be supported. The file names below are
  34.     in /usr/src/linux/drivers/net/
  35.     ----------------------------------------------------------------
  36.     wd.c:        0x300, 0x280, 0x380, 0x240
  37.     3c501.c        0x280
  38.     3c503.c:    0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2a0, 0x2e0
  39.     3c507.c:    0x300, 0x320, 0x340, 0x280
  40.     3c509.c:    <Special "ID Port" probe>
  41.     at1700.c:    0x300, 0x280, 0x380, 0x320, 0x340, 0x260, 0x2a0, 0x240
  42.     atp.c:        0x378, 0x278, 0x3bc
  43.     depca.c        0x300, 0x200
  44.     d_link.c:    0x378
  45.     ne.c:        0x300, 0x280, 0x320, 0x340, 0x360
  46.     hp.c:        0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240
  47.     lance.c:    0x300, 0x320, 0x340, 0x360
  48.     smc-ultra.c:    0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380
  49.     eexpress.c:    0x300, 0x270, 0x320, 0x340
  50.     3c509.c:    <Special "ID Port" probe>
  51.     ----------------------------------------------------------------
  52.     There are some NE2000 clone ethercards out there that are waiting black
  53.     holes for autoprobe drivers. While many NE2000 clones are
  54.     safe until they are enabled, some can't be reset to a safe mode.
  55.     These dangerous ethercards will hang any I/O access to their
  56.     "dataports". The typical dangerous locations are:
  57.  
  58.     Ethercard jumpered base     Dangerous locations (base + 0x10 - 0x1f)
  59.         0x300 *                0x310-0x317
  60.         0x320                0x330-0x337
  61.         0x340                0x350-0x357
  62.         0x360                0x370-0x377
  63.  
  64.     * The 0x300 location is the traditional place to put an ethercard, but
  65.     it's also a popular place to put other devices (often SCSI
  66.     controllers). The 0x320 location is often the next one chosen, but
  67.     that's bad for for the AHA1542 driver probe. The 0x360 location is
  68.     bad, because it conflicts with the parallel port at 0x378.
  69.  
  70.     To avoid these lurking ethercard, here are the things you can do:
  71.  
  72.     o Probe for the device's BIOS in memory space. This is easy
  73.       and always safe, but it only works for cards that always have
  74.       BIOSes, like primary SCSI controllers.
  75.  
  76.     o Avoid probing any of the above locations until you think
  77.       you've located your device. The NE2000 clones have a reset range
  78.       from <base>+0x18 to <base>+0x1f that will read as 0xff, so probe
  79.       there first if possible. It's also safe to probe in the 8390
  80.       space at <base>+0x00 - <base>+0x0f, but that area will return
  81.       quasi-random values
  82.  
  83.     o If you must probe in the dangerous range, for instance if your
  84.       target device has only a few port locations, first check that
  85.       there isn't an NE2000 there. You can see how to do this by
  86.       looking at the probe code in /usr/src/linux/net/inet/ne.c
  87.  
  88.     In other news, I've written the code for the I/O port registrar.
  89.     Peter MacDonald and I have been intensely discussing this, and I think
  90.     our current scheme has the necessary functionality with minimal kernel
  91.     size impact. (The implementation involved rewriting the bitmap ops in
  92.     kernel/ioport.c:ioperm() so that most code could be shared.)
  93.  
  94.     Here is the current "blurb". As usual comments are welcome. Please
  95.     keep them substantial and constructive (we've already talked about
  96.     changing the name from "reserve=" to "noprobe=").
  97.  
  98.     ==================
  99.  
  100.     Boot-Time Parameters: "reserve="
  101.     
  102.     In some machines it may be necessary to prevent device drivers from
  103.     checking for devices (auto-probing) in a specific region. This may be
  104.     because of poorly designed hardware that causes the boot to "freeze"
  105.     (such as some ethercards), hardware that is mistakenly identified,
  106.     hardware whose state is changed by an earlier probe, or merely
  107.     hardware you don't want the kernel to initialize.
  108.  
  109.     The "reserve" boot-time argument addresses this problem by specifying
  110.     an I/O port region that shouldn't be probed. That region is reserved
  111.     in the kernel's port registration table as if a device has already
  112.     been found in that region. Note that this mechanism shouldn't be
  113.     necessary on most machine, only when there is a problem or special
  114.     case.
  115.  
  116.     The boot-line syntax is
  117.  
  118.       lilo-prompt: linux-image reserve=[<port>,<size>,<port>,<size>...]
  119.  
  120.     As usual with boot-time specifiers there is an 11 parameter limit, thus
  121.     you can only specify 5 reserved regions per "reserve" keyword.
  122.     Multiple "reserve" specifiers will work if you have an usually
  123.     complicated request.
  124.  
  125.     If you specify a "reserve" region to protect a specific device, you
  126.     must generally specify an explicit probe for that device. Most
  127.     drivers ignore the port registration table if they are given an
  128.     explicit address.
  129.  
  130. 5.02 Skeleton / prototype driver
  131.  
  132.     OK. So you have decided that you want to write a driver for the
  133.     Foobar Ethernet card, as you have the programming information,
  134.     and it hasn't been done yet. (...these are the two main require-
  135.     ments ;-) You can use the skeleton network driver that is provided
  136.     with the Linux kernel source tree. It can be found in the file
  137.     /usr/src/linux/drivers/net/skeleton.c as of 0.99pl15, and later.
  138.  
  139.     It's also very useful to look at the Crynwr (nee Clarkson) driver
  140.     for your target ethercard, if it's available. Russ Nelson
  141.     <nelson@crynwr.com> has been actively updating and writing these,
  142.     and he has been very helpful with his code reviews of the current
  143.     Linux drivers.
  144.  
  145. 5.03 Driver interface to the kernel
  146.  
  147.     Here are some notes that may help when trying to figure out what
  148.     the code in the driver segments is doing, or perhaps what it is
  149.     supposed to be doing.
  150.  
  151.     =====================================================
  152.  
  153.     int ethif_init(struct device *dev)
  154.     {
  155.         ...
  156.         dev->send_packet = &ei_send_packet;
  157.         dev->open = &ei_open;
  158.         dev->stop = &ei_close;
  159.         dev->hard_start_xmit = &ei_start_xmit;
  160.         ...
  161.     }
  162.  
  163.     int ethif_init(struct device *dev)
  164.  
  165.     This function is put into the device structure in Space.c. It is
  166.     called only at boot time, and returns '0' iff the ethercard 'dev'
  167.     exists.
  168.  
  169.     =====================================================
  170.  
  171.     static int ei_open(struct device *dev)
  172.     static int ei_close(struct device *dev)
  173.  
  174.     This routine opens and initializes the board in response to an
  175.     socket ioctl() usually called by 'config' or 'ifconfig'. It is
  176.     commonly stuffed into the 'struct device' by ethif_init().
  177.  
  178.     The inverse routine is ei_close(), which should shut down the
  179.     ethercard, free the IRQs and DMA channels if the hardware permits,
  180.     and turn off anything that will save power (like the transceiver).
  181.  
  182.     (Note: As of NET-2, the relevant program is '/etc/ifconfig' - and
  183.     the device *can* be turned off or on via passing 'up' or 'down'
  184.     to 'ifconfig' from the command line with the device name.)
  185.  
  186.     =====================================================
  187.  
  188.     static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
  189.         dev->hard_start_xmit = &ei_start_xmit;
  190.  
  191.     This routine puts packets to be transmitted into the hardware. It
  192.     is usually stuffed into the 'struct device' by ethif_init().
  193.  
  194.     When the hardware can't accept additional packets it should set
  195.     the dev->tbusy flag. When additional room is available, usually
  196.     during a transmit-complete interrupt, dev->tbusy should be cleared
  197.     and the higher levels informed with mark_bh(INET_BH).
  198.     [[Note: pre0.99.4 kernels didn't use this interface for all packets.]]
  199.     
  200.     =====================================================
  201.  
  202.     ...
  203.         if (dev_rint(buffer, length, is_skb ? IN_SKBUFF : 0, dev))
  204.            stats->rx_dropped++;
  205.     ...
  206.     A received packet is passed to the higher levels using dev_rint().
  207.     If the unadorned packet data in a memory buffer, dev_rint will copy
  208.     it into a 'skbuff' for you. Otherwise a new skbuff should be
  209.     kmalloc()ed, filled, and passed to dev_rint() with the IN_SKBUFF flag.
  210.  
  211.     =====================================================
  212.  
  213. 5.04 Interrupts and Linux
  214.  
  215.     There are two kinds of interrupt handlers in Linux:
  216.     fast ones and slow ones. You decide what kind you are installing by
  217.     the flags you pass to irqaction(). The fast ones, such as the serial
  218.     interrupt handler, run with _all_ interrupts disabled. The normal
  219.     interrupt handlers, such as the one for ethercard drivers, runs with
  220.     other interrupts enabled.
  221.  
  222.     There is a two-level interrupt structure. The "fast" part handles the
  223.     device register, removes the packets, and perhaps sets a flag.  After
  224.     it is done, and interrupts are re-enabled, the slow part is run if the
  225.     flag is set.
  226.  
  227.     The flag between the two parts is set by:
  228.         mark_bh(INET_BH);
  229.  
  230.     Usually this flag is set within dev_rint() during a received-packet
  231.     interrupt, and set directly by the device driver during a
  232.     transmit-complete interrupt.
  233.  
  234.     You might wonder why all interrupt handlers cannot run in
  235.     "normal mode" with other interrupts enabled. Ross Biro uses this
  236.     scenario to illustrate the problem:
  237.         o You get a serial interrupt, and start processing it.
  238.           The serial interrupt is now masked.
  239.         o You get a network interrupt, and you start transferring
  240.           a maximum-sized 1500 byte packet from the card.
  241.         o Another character comes in, but this time the interrupts
  242.           are masked!
  243.  
  244.     The "fast" interrupt structure solves this problem by allowing
  245.     bounded-time interrupt handlers to run without the risk of leaving
  246.     their interrupt lines masked by another interrupt request.
  247.  
  248.     There is an additional distinction between fast and slow interrupt
  249.     handlers -- the arguments passed to the handler. A "slow" handler is
  250.     defined as
  251.  
  252.         static void
  253.         handle_interrupt(int reg_ptr)
  254.         {
  255.             int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2);
  256.             struct device *dev = irq2dev_map[irq];
  257.         ...
  258.  
  259.     While a fast handler gets the interrupt number directly
  260.  
  261.         static void
  262.         handle_fast_interrupt(int irq)
  263.         {
  264.         ...
  265.  
  266.     A final aspect of network performance is latency. The only board
  267.     that really addresses this is the 3c509, which allows a predictive
  268.     interrupt to be posted. It provides an interrupt response timer so
  269.     that the driver can fine-tune how early an interrupt is generated.
  270.  
  271.     Alan Cox has some advice for anyone wanting to write drivers
  272.     that are to be used with pl14 kernels and newer. He says:
  273.  
  274.     "Any driver intended for pl14 should use the new alloc_skb() and
  275.     kfree_skbmem() functions rather than using kmalloc() to obtain an
  276.     sk_buff. The new pl14 skeleton does this correctly. For drivers
  277.     wishing to remain compatible with both sets the define
  278.     'HAVE_ALLOC_SKB' indicates these functions must be used.
  279.  
  280.     In essence replace
  281.  
  282.         skb=(struct sk_buff *)kmalloc(size)
  283.     with
  284.  
  285.         skb=alloc_skb(size)
  286.  
  287.     and
  288.  
  289.         kfree_s(skb,size)
  290.  
  291.     with
  292.  
  293.         kfree_skbmem(skb,size)    /* Only sk_buff memory though */
  294.  
  295.     Any questions should I guess be directed to me since I made the change.
  296.     This is a change to allow tracking of sk_buff's and sanity checks on
  297.     buffers and stack behaviour. If a driver produces the message
  298.     'File: ??? Line: ??? passed a non skb!' then it is probable the
  299.     driver is not using the new sk_buff allocators."
  300.  
  301.  
  302. 5.05 Programmed I/O vs. shared mem. vs. slave/master DMA
  303.  
  304.     Ethernet is 10Mbs. (Don't be pedantic, 3Mbs and 100Mbs don't count.)
  305.     If you can already send and receive back-to-back packets, you just
  306.     can't put more bits over the wire. Every modern ethercard can receive
  307.     back-to-back packets. The Linux DP8390 drivers come pretty close to
  308.     sending back-to-back packets (depending on the current interrupt
  309.     latency) and the 3c509 and AT1500 hardware has no problem at all
  310.     automatically sending back-to-back packets.
  311.  
  312.     The ISA bus can do 5.3MB/sec (42Mb/sec), which sounds like more than
  313.     enough. You can use that bandwidth in several ways:
  314.  
  315.     Programmed I/O
  316.     ==============
  317.       Pro: Doesn't use any constrained system resources,
  318.            just a few I/O registers, and has no 16M limit.
  319.       Con: Usually the slowest transfer rate, the CPU is waiting
  320.            the whole time, and interleaved packet access is usually
  321.            difficult to impossible.
  322.  
  323.     Shared memory
  324.     =============
  325.       Pro: Simple, faster than programmed I/O, and allows random
  326.            access to packets.
  327.       Con: Uses up memory space (a big one for DOS users, only a minor
  328.            issue under Linux), and it still ties up the CPU.
  329.  
  330.     Slave (normal) DMA
  331.     ==================
  332.       Pro: Frees up the CPU during the actual data transfer.
  333.       Con: Checking boundary conditions, allocating contiguous buffers,
  334.            and programming the DMA registers makes it the slowest
  335.            of all techniques.  It also uses up a scarce DMA
  336.            channel, and requires aligned low memory buffers.
  337.  
  338.     Master (bus-master) DMA
  339.     =======================
  340.       Pro: Frees up the CPU during the data transfer, can string together
  341.            buffers, can require little or no CPU time lost on the
  342.            ISA bus.
  343.       Con: Requires low-memory buffers and a DMA channel. Any
  344.            bus-master will have problems with other bus-masters that
  345.            are bus-hogs, such as some primitive SCSI adaptors. A few
  346.            badly-designed motherboard chipsets have problems with
  347.            bus-masters. And a reason for not using *any* type of
  348.            DMA device is using a Cyrix 486 processor designed for
  349.            plug-in replacement of a 386: these processors must
  350.            flush their cache with each DMA cycle.
  351.  
  352. 5.06 Programming the Intel chips (i82586 and i82593)
  353.  
  354.     These chips are used on a number of cards, namely the 3c507 ('86),
  355.     the Intel EtherExpress 16 ('86), Microdyne's exos205t ('86),
  356.     the Z-Note ('93), and the Racal-Interlan ni5210 ('86).
  357.  
  358.     Russ Nelson writes:
  359.     "Most boards based on the 82586 can reuse quite a bit of their code.
  360.     More, in fact, than the 8390-based adapters. There are only three
  361.     differences between them:
  362.  
  363.       o The code to get the Ethernet address,
  364.       o The code to trigger CA on the 82586, and
  365.       o The code to reset the 82586.
  366.  
  367.     The Intel EtherExpress 16 is an exception, as it I/O maps the 82586.
  368.     Yes, I/O maps it. Fairly clunky, but it works.
  369.  
  370.     Garrett Wollman did an AT&T driver for BSD that uses the BSD
  371.     copyright. The latest version I have (Sep '92) only uses a single
  372.     transmit buffer. You can and should do better than this if you've
  373.     got the memory. The AT&T and 3c507 adapters do; the ni5210 doesn't.
  374.  
  375.     The people at Intel gave me a very big clue on how you queue up
  376.     multiple transmit packets. You set up a list of
  377.     NOP->XMIT->NOP->XMIT->NOP->XMIT->(beginning) blocks, then you set the
  378.     "next" pointer of all the NOP blocks to themselves. Now you start
  379.     the command unit on this chain. It continually processes the first
  380.     NOP block. To transmit a packet, you stuff it into the next transmit
  381.     block, then point the NOP to it. To transmit the next packet, you
  382.     stuff the next transmit block and point the previous NOP to *it*. In
  383.     this way, you don't have to wait for the previous transmit to finish,
  384.     you can queue up multiple packets without any ambiguity as to whether
  385.     it got accepted, and you can avoid the command unit start-up delay."
  386.  
  387. 5.07    Technical information from 3Com
  388.  
  389.     From: Cameron Spitzer 764-6339 <camerons@nad.3com.com>
  390.     Subject: getting 3Com Adapter manuals
  391.     Date: Mon, 27 Sep 1993 21:17:07 +0200
  392.     
  393.     Since this is becoming a FAQ, I'm going to tread the thin
  394.     ice of No Commercial Use and answer it here.
  395.  
  396.     3Com's Ethernet Adapters are documented for driver writers
  397.     in our "Technical References" (TRs). These manuals describe
  398.     the programmer interfaces to the boards but they don't talk
  399.     about the diagnostics, installation programs, etc that end
  400.     users can see.
  401.     
  402.     The Network Adapter Division marketing department has the
  403.     TRs to give away. To keep this program efficient, we
  404.     centralized it in a thing called "CardFacts." CardFacts is
  405.     an automated phone system. You call it with a touch-tone
  406.     phone and it faxes you stuff. To get a TR, call CardFacts
  407.     at 408-727-7021. Ask it for Developer's Order Form,
  408.     document number 9070. Have your fax number ready when you
  409.     call. Fill out the order form and fax it to 408-764-5004.
  410.     Manuals are shipped by Federal Express 2nd Day Service.
  411.     
  412.     If you don't have a fax and nobody you know has a fax,
  413.     really and truly, *then* send mail to
  414.     Terry_Murphy@3Mail.3Com.com and tell her about your problem.
  415.     PLEASE use the fax thing if you possibly can.
  416.     
  417.     After you get a manual, if you still can't figure out how to
  418.     program the board, try our "CardBoard" BBS at
  419.     1-800-876-3266, and if you can't do that, write
  420.     Andy_Chan@3Mail.3com.com and ask him for alternatives. If
  421.     you have a real stumper that nobody has figured out yet, the
  422.     fellow who needs to know about it is
  423.     Steve_Lebus@3Mail.3com.com.
  424.     
  425.     There are people here who think we are too free with the
  426.     manuals, and they are looking for evidence that the system
  427.     is too expensive, or takes too much time and effort. That's
  428.     why it's important to try to use CardFacts *before* you
  429.     start calling and mailing the people I named here.
  430.     
  431.     There are even people who think we should be like Diamond
  432.     and Xircom, requiring tight "partnership" with driver
  433.     writers to prevent poorly performing drivers from getting
  434.     written. So far, 3Com customers have been really good about
  435.     this, and there's no problem with the level of requests
  436.     we've been getting. We need your continued cooperation and
  437.     restraint to keep it that way.
  438.     
  439.     Cameron Spitzer, 408-764-6339
  440.     3Com NAD
  441.     Santa Clara
  442.     work: camerons@nad.3com.com
  443.     home: cls@truffula.sj.ca.us
  444.  
  445. 5.08 Notes on AMD PCnet-ISA / LANCE Based cards (79C960)
  446.  
  447.     The AMD LANCE (Local Area Network Controller for Ethernet)
  448.     was the original offering, and has since been replaced by
  449.     the "PCnet-ISA" chip, otherwise known as the 79C960.
  450.     A relatively new chip from AMD, the 79C960, is the heart of many
  451.     new cards being released at present. Note that the name "LANCE"
  452.     has stuck, and some people will refer to the new chip by the old
  453.     name. Dave Roberts of the Network Products Division of AMD was kind
  454.     enough to contribute the following information regarding this chip:
  455.  
  456.     "As for the architecture itself, AMD developed it originally
  457.     and reduced it to a single chip -- the PCnet(tm)-ISA -- over a year
  458.     ago. It's been selling like hotcakes ever since.
  459.  
  460.     Functionally, it is equivalent to a NE1500. The register set
  461.     is identical to the old LANCE with the 1500/2100 architecture
  462.     additions. Older 1500/2100 drivers will work on the PCnet-ISA.
  463.     The NE1500 and NE2100 architecture is basically the same.
  464.     Initially Novell called it the 2100, but then tried to distinguish
  465.     between coax and 10BASE-T cards. Anything that was 10BASE-T only was
  466.     to be numbered in the 1500 range. That's the only difference.
  467.  
  468.     Many companies offer PCnet-ISA based products, including HP,
  469.     Racal-Datacom, Allied Telesis, Boca Research, Kingston Technology, etc.
  470.     The cards are basically the same except that some manufacturers
  471.     have added "jumperless" features that allow the card to
  472.     be configured in software. Most have not. AMD offers a standard
  473.     design package for a card that uses the PCnet-ISA and many
  474.     manufacturers use our design without change.
  475.     What this means is that anybody who wants to write drivers for
  476.     most PCnet-ISA based cards can just get the data-sheet from AMD. Call
  477.     our literature distribution center at (800)222-9323 and ask for the
  478.     Am79C960, PCnet-ISA data sheet. It's free.
  479.  
  480.     A quick way to understand whether the card is a "stock" card
  481.     is to just look at it. If it's stock, it should just have one large
  482.     chip on it, a crystal, a small IEEE address PROM, possibly a socket
  483.     for a boot ROM, and a connector (1, 2, or 3, depending on the media
  484.     options offered). Note that if it's a coax card, it will have some
  485.     transceiver stuff built onto it as well, but that should be near the
  486.     connector and away from the PCnet-ISA.
  487.  
  488.     The PCnet-ISA is faster than the original LANCE design and
  489.     makes better use of the available bus bandwidth. Additionally, some
  490.     LANCE bugs were corrected and many enhancements were made."
  491.  
  492.     There is also some info regarding the LANCE chip in the file
  493.     lance.c which is included in the standard kernel.
  494.  
  495. 5.09 Multicast and Promiscuous mode
  496.  
  497.     One of the things I've been working on recently is the
  498.     major remaining item on the ethercard feature list:
  499.     implementing multicast and promiscuous mode hooks.
  500.     
  501.     At first I was planning to do it while implementing either
  502.     the /dev/* or DDI interface, but that's not really the
  503.     correct way to do it. We should only enable multicast or
  504.     promiscuous modes when something wants to look at the
  505.     packets, and shut it down when that application is
  506.     finished, neither of which is strongly related to when the
  507.     hardware is opened or released.
  508.     
  509.     I'll start by discussing promiscuous mode, which is
  510.     conceptually easy to implement. For most hardware you
  511.     only have to set a register bit, and from then on you get
  512.     every packet on the wire. Well, it's almost that easy;
  513.     for some hardware you have to shut the board (potentially
  514.     dropping a few packet), reconfigure it, and then re-enable
  515.     the ethercard. This is grungy and risky, but the
  516.     alternative seems to be to have every application register
  517.     before you open the ethercard at boot-time.
  518.     
  519.     OK, so that's easy, so I'll move on something that's not
  520.     quite so obvious: Multicast. It can be done two ways:
  521.     
  522.     1) Use promiscuous mode, and a packet filter like the
  523.        Berkeley packet filter (BPF). The BPF is a pattern matching
  524.        stack language, where you write a program that picks out the
  525.        addresses you are interested in. Its advantage is that it's
  526.        very general and programmable. Its disadvantage is that there
  527.        is no general way for the kernel to avoid turning on promiscuous
  528.        mode and running every packet on the wire through every registered
  529.        packet filter. See the next section for more information on BPF.
  530.     
  531.     2) Using the built-in multicast filter that most etherchips have.
  532.     
  533.     I guess I should list what a few ethercards/chips provide:
  534.     
  535.     Chip/card  Promiscuous    Multicast filter
  536.     ========================================
  537.     Seeq8001/3c501    Yes    Binary filter (1)
  538.     3Com/3c509    Yes    Binary filter (1)
  539.     8390        Yes    Autodin II six bit hash (2) (3)
  540.     LANCE        Yes    Autodin II six bit hash (2) (3)
  541.     i82586        Yes    Hidden Autodin II six bit hash (2) (4)
  542.     
  543.     
  544.     (1) These cards claim to have a filter, but it's a simple
  545.     yes/no 'accept all multicast packets', or 'accept no
  546.     multicast packets'.
  547.     
  548.     (2) AUTODIN II is the standard ethernet CRC (checksum)
  549.     polynomial. In this scheme multicast addresses are hashed
  550.     and looked up in a hash table. If the corresponding bit
  551.     is enabled, this packet is accepted. Ethernet packets are
  552.     laid out so that the hardware to do this is trivial -- you
  553.     just latch six (usually) bits from the CRC circuit (needed
  554.     anyway for error checking) after the first six octets (the
  555.     destination address), and use them as an index into the
  556.     hash table (six bits == a 64-bit table).
  557.     
  558.     (3) These chips use the six bit hash, and must have the
  559.     table computed and loaded by the host. This means the
  560.     kernel must include the CRC code.
  561.     
  562.     (4) The 82586 uses the six bit hash internally, but it
  563.     computes the hash table itself from a list of multicast
  564.     addresses to accept.
  565.  
  566.     Note that none of these chips do perfect filtering, and we
  567.     still need a middle-level module to do the final
  568.     filtering. Also note that in every case we must keep a
  569.     complete list of accepted multicast addresses to recompute
  570.     the hash table when it changes.
  571.     
  572.     My first pass at device-level support is detailed in the
  573.     new outline driver skeleton.c (pl14 and up.)
  574.  
  575.     It looks like the following:
  576.     
  577.     #ifdef HAVE_MULTICAST
  578.     static void set_multicast_list(struct device *dev, int num_addrs,
  579.                      void *addrs);
  580.     #endif
  581.     .
  582.     .
  583.     
  584.     ethercard_open() {
  585.     ...
  586. #ifdef HAVE_MULTICAST
  587.         dev->set_multicast_list = &set_multicast_list;
  588.     #endif
  589.     ...
  590.     
  591.     #ifdef HAVE_MULTICAST
  592.     /* Set or clear the multicast filter for this adaptor.
  593.        num_addrs == -1    Promiscuous mode, receive all packets
  594.        num_addrs == 0    Normal mode, clear multicast list
  595.        num_addrs > 0    Multicast mode, receive normal and
  596.                 MC packets, and do best-effort filtering.
  597.      */
  598.     static void
  599.     set_multicast_list(struct device *dev, int num_addrs, void *addrs)
  600.     {
  601.     ...
  602.  
  603.     Any comments, criticism, etc. are welcome.
  604.  
  605.     Alan Cox adds that "...in pl14, user programs can access promiscuous
  606.     mode but not multicast mode, even though the drivers support both.
  607.     The ifconfig program allows you to mark an interface 'promisc'."
  608.     
  609. 5.10 The Berkeley Packet Filter (BPF)
  610.  
  611.     I'm not bitterly opposed to it, but I'm coming to the
  612.     conclusion that the 'bpf' functionality should not be provided
  613.     by the kernel, but should be in a (hopefully little-used)
  614.     compatibility library.
  615.     
  616.     For those not in the know: 'bpf' (the Berkeley Packet Filter)
  617.     is an mechanism for specifying to the kernel networking layers
  618.     what packets you are interested in. It's implemented as a
  619.     specialized stack language interpreter built into a low level
  620.     of the networking code. An application passes a program
  621.     written in this language to the kernel, and the kernel runs the
  622.     program on each incoming packet. If the kernel has multiple
  623.     'bpf' applications, each program is run on each packet.
  624.     
  625.     The problem is that it's difficult to deduce what kind of
  626.     packets the application is really interested in from the packet
  627.     filter program, so the general solution is to always run the
  628.     filter. Imagine a program that registers a 'bpf' program to
  629.     pick up a low data-rate stream sent to a multicast address.
  630.     Most ethernet cards have a hardware multicast address filter
  631.     implemented as a 64 entry hash table that ignores most unwanted
  632.     multicast packets, so the capability exists to make this a very
  633.     inexpensive operation. But with the BFP the kernel must switch
  634.     the interface to promiscuous mode, receive _all_ packets, and
  635.     run them through this filter. This is work, BTW, that's very
  636.     difficult to account back to the process requesting the packets.
  637.  
  638. 5.11 Unresolved questions / concerns
  639.  
  640.     There may be some benefit from processing packet data as it is
  641.     transferred to and from the ethercard, especially with very fast
  642.     processors transferring data to a slow ethercard. As I see it this
  643.     question has multiple parts:
  644.         1) Is there any useful processing power available, perhaps
  645.            during the ISA bus recovery period, or while the 8390
  646.            remote DMA is preparing for another transfer??
  647.         2) Is there any useful but simple work that can be done
  648.            between/during each word of the copy, such as calculating
  649.            a CRC, or discarding obviously unwanted packets??
  650.         3) would the complexity of an interface to do this make future
  651.            ethercard drivers impossible??
  652.  
  653.     There should be a better structure than Space.c - Drivers should be
  654.     able to autoprobe for all installed ethercards rather than just
  655.     quitting after finding the first.  I've written code to do this,
  656.     but the constant promise (threat?) of DDI has prevented me from
  657.     making it standard.
  658.  
  659.     A related topic is the problem of driver probes corrupting
  660.     unrelated hardware. Even worse is a probe into a dataport that
  661.     isn't set up to transfer data, which will freeze the machine. The
  662.     common suggestion is a boot-time device registry that records
  663.     already-used I/O ports and shared memory. This has been implemented
  664.     as of pl13, see section 5.01.
  665.  
  666. 6 Possible problems, and troubleshooting.
  667.  
  668.     This section tries to answer any unresolved questions, and not so
  669.     common solutions to common problems. They are sorted on a "per
  670.     manufacturer basis". You should have also read the relevant info.
  671.     from section 1 about your specific card. Section 8 contains more
  672.     general FAQ's.
  673.  
  674. 6.01 Problems with NE2000 (and clones)
  675.  
  676.     "DMA address mismatch"
  677.     ======================
  678.  
  679.     Is the chip a real NatSemi 8390? (DP8390, DP83901, DP83902 or DP83905)?
  680.     If not, some clone chips don't correctly implement the transfer
  681.     verification register. MS-DOS drivers never do error checking,
  682.     so it doesn't matter to them.
  683.  
  684.     Are most of the messages off by a factor of 2?
  685.     If so:    Are you using the NE2000 in a 16 bit slot?
  686.         Is it jumpered to use only 8 bit transfers?
  687.  
  688.     The Linux driver expects a NE2000 to be a 16 bit slot. A NE1000 can
  689.     be in either size slot. This problem can also occur with some clones,
  690.     notably D-Link 16 bit cards, that don't have the correct ID bytes
  691.     in the station address PROM. [[ This should be fixed in pl12.]]
  692.  
  693.     Are you running the bus faster than 8Mhz?
  694.     If you can change the speed (faster or slower), see if that
  695.     makes a difference. Most NE2000 clones will run at 16Mhz, but
  696.     some may not. Changing speed can also mask a noisy bus.
  697.  
  698.     What other devices are on the bus?
  699.     If moving the devices around changes the reliability, then you
  700.     have a bus noise problem -- just what that error message was
  701.     designed to detect. Congratulations, you've probably found the
  702.     source of other problems as well.
  703.  
  704.     Machine Hangs during Boot.
  705.     ==========================
  706.  
  707.     Problem:  The machine hangs during boot right after the "8390..."  or
  708.           "WD...." message. Removing the NE2000 fixes the problem.
  709.  
  710.     Solution: Change your NE2000 base address to 0x360 (or 0x340 for
  711.           pl12 or later kernels.) Alternatively, you can use the new
  712.           device registrar implemented in pl13 (see section 5.1)
  713.  
  714.     Reason:   Your NE2000 clone isn't a good enough clone. An active
  715.           NE2000 is a bottomless pit that will trap any driver
  716.           autoprobing in its space. The other ethercard drivers take
  717.           great pain to reset the NE2000 so that it's safe, but some
  718.           clones cannot be reset. Clone chips to watch out for:
  719.           Winbond 83C901. Changing the NE2000 to a less-popular
  720.           address will move it out of the way of other autoprobes,
  721.           allowing your machine to boot.
  722.  
  723.     Problem:  The machine hangs during the SCSI probe at boot.
  724.  
  725.     Solution: It's the same problem as above, change the
  726.           ethercard's address, or use the device registrar.
  727.  
  728.     Problem:  The machine hangs during the soundcard probe at boot.
  729.  
  730.     Solution: No, that's really during the silent SCSI probe, and it's
  731.           the same problem as above.
  732.  
  733.     "eth0: DMAing conflict in ne_block_input"
  734.     =========================================
  735.  
  736.     This bug came from timer-based packet retransmissions. If you got a
  737.     timer tick _during_ a ethercard RX interrupt, and timer tick tried to
  738.     retransmit a timed-out packet, you could get a conflict. Because of
  739.     the design of the NE2000 you would have the machine hang (exactly the
  740.     same the NE2000-clone boot hangs).
  741.  
  742.     Early versions of the driver disabled interrupts for a long time,
  743.     and didn't have this problem. Later versions are fixed. (ie. kernels
  744.     after 0.99p9 should be OK.)
  745.  
  746.     NE2000 not detected at boot.
  747.     ============================
  748.  
  749.     A few people have reported a problem with detecting the Accton NE2000.
  750.     This problem occurs only at boot-time, and the card is later detected
  751.     at run-time by the identical code my (alpha-test) ne2k diagnostic
  752.     program. Accton has been very responsive, but I still haven't tracked
  753.     down what is going on. I've been unable to reproduce this problem
  754.     with the Accton cards we purchased. If you are having this problem,
  755.     please send me an immediate bug report. For that matter, if you have
  756.     an Accton card send me a success report, including the type of the
  757.     motherboard. I'm especially interested in finding out if this problem
  758.     moves with the particular ethercard, or stays with the motherboard.
  759.     
  760.     Here are some things to try, as they have fixed it for some people:
  761.     1) Change the bus speed, or just move the card to a different slot (!).
  762.     2) Change the "I/O recovery time" parameter in the BIOS
  763.        chipset configuration.
  764.     3) Make the following code change suggested by David Cutler,
  765.        <dave@dmitri.ucdavis.edu> to ne.c around line 150:
  766.  
  767.         for(i = 0; i < 32 /*sizeof(SA_prom)*/; i+=2) {
  768.     -        SA_prom[i] = inb_p(ioaddr + NE_DATAPORT);
  769.     -        SA_prom[i+1] = inb_p(ioaddr + NE_DATAPORT);
  770.     +        SA_prom[i] = inb(ioaddr + NE_DATAPORT);
  771.     +        SA_prom[i+1] = inb(ioaddr + NE_DATAPORT);
  772.             if (SA_prom[i] != SA_prom[i+1])
  773.                 wordlength = 1;
  774.         }
  775.  
  776.     Yes, this removes the delay between board accesses, something that
  777.     would normally increase the likelihood of data corruption rather
  778.     than decreasing it. Note that this change is already incorporated
  779.     into pl15. If you have an older kernel, you may have to do it
  780.     yourself.
  781.  
  782. 6.02 Problems with WD80*3 cards
  783.  
  784.     Detected Non-existent Ethercard
  785.     ===============================
  786.  
  787.     Problem:  A WD80*3 is falsely detected. Removing the sound or
  788.           MIDI card eliminates the "detected" message.
  789.  
  790.     Solution: Update your ethercard driver: new versions include an
  791.           additional sanity check.
  792.  
  793.     Reason:   Some MIDI ports happen to produce the same checksum as a
  794.           WD ethercard.
  795.  
  796.     Error messages from the 80*3
  797.     ============================
  798.  
  799.     Problem:  You get messages such as the following with your 80*3:
  800.             eth0: bogus packet size, status = ........
  801.             kmalloc called with impossibly large argument (65400)
  802.             eth0: Couldn't allocate sk_buff of size 65400
  803.             eth0: receiver overrun
  804.  
  805.     Reason:   There is a shared memory problem.
  806.  
  807.     Solution: If the problem is sporadic, you have hardware problems.
  808.           Typical problems that are easy to fix are board conflicts,
  809.           having cache or "shadow ROM" enabled for that region, or
  810.           running your bus faster than 8Mhz. There are also a
  811.           surprising number of memory failures on ethernet cards,
  812.           so run a diagnostic program if you have one for your
  813.           ethercard.
  814.  
  815.           If the problem is continual, and you have have to reboot
  816.           to fix the problem, record the boot-time probe message
  817.           and mail it to becker@super.org - Take particular note of
  818.           the shared memory location.
  819.  
  820.     Will not detect my 80x3
  821.     =======================
  822.  
  823.     Reason:   The Mitsumi CD-ROM (mcd) driver probe at 0x300 will
  824.           succeed if just about *anything* is that I/O location.
  825.           This is bad news and needs to be a bit more robust. (pl15)
  826.           Once another driver registers that it "owns" an I/O
  827.           location, other drivers (incl. the wd80x3) are "locked
  828.           out" and can not probe that addr for a card.
  829.  
  830.     Solution: Recompile a new kernel without any excess drivers that
  831.           you aren't using, including the above mcd driver.
  832.           Or try moving your ethercard to a new I/O addr. Valid
  833.           I/O addr. for all the cards are listed in section 5.1
  834.           You can also point the mcd driver off in another direction
  835.           by a boot-time parameter (via LILO) such as:
  836.             "mcd=0x200,12"
  837.  
  838. 6.03 Problems with 3Com cards
  839.  
  840.     Choosing the Interrupt of the 3c503
  841.     ===================================
  842.  
  843.     Problem:  The 3c503 picks IRQ n at boot, but this is needed for some
  844.           other device which needs IRQ n. (eg. CD ROM driver, etc.)
  845.           Can this be fixed without compiling this into the kernel?
  846.  
  847.     Solution: The 3c503 driver probes for a free IRQ line in the order
  848.           {5, 9/2, 3, 4}, and it should pick a line which isn't being
  849.           used. The pre-pl12 (SLS 1.02) driver picked the IRQ line
  850.           at boot-time, and the current driver (pl12) chooses when
  851.           the card is open()/'ifconfig'ed. Note the "bug" noted in
  852.           the 3c503 section in 1.01
  853.  
  854.           Alternately, you can fix the IRQ at boot by passing
  855.           parameters via LILO. The following selects IRQ9, base
  856.           location 0x300, <ignored value>, and if_port #1 (the
  857.           external transceiver).
  858.             lilo: linux ether=9,0x300,0,1,eth0
  859.  
  860.           The following selects IRQ3, probes for the base location,
  861.           <ignored value>, and the default if_port #0 (the internal
  862.           transceiver)
  863.             lilo: linux ether=3,0,0,0,eth0
  864.  
  865.     "3c503: Configured interrupt number XX is out of range."
  866.     ========================================================
  867.  
  868.     Problem:  Whoever built your kernel fixed the ethercard IRQ at XX.
  869.  
  870.     Reason:   The above is truly evil, and worse than that, it is
  871.           not necessary. The 3c503 will autoIRQ when it gets
  872.           "ifconfig"ed, and pick one of IRQ{5, 2/9, 3, 4}.
  873.  
  874.     Solution: Use lilo to set the IRQ, or rebuild the kernel, enabling
  875.           autoIRQ by not specifying the IRQ line.
  876.  
  877.     Choosing the output of the 3c503
  878.     ================================
  879.  
  880.     Problem:  The supplied 3c503 drivers don't use the AUI (thicknet) port.
  881.           How does one choose it over the default thinnet port?
  882.  
  883.     Solution: The 3c503 AUI port can be selected at boot-time with 0.99pl12
  884.           and later. The selection is overloaded onto the low bit of
  885.           the currently-unused dev->rmem_start variable, so a boot-time
  886.           parameter of:
  887.             lilo: linux ether=0,0,0,1,eth0
  888.           should work. A boot line to force IRQ 5, port base 0x300,
  889.           and use an external transceiver is:
  890.             lilo: linux ether=5,0x300,0,1,eth0
  891.  
  892. 7 Networking with a laptop computer
  893.  
  894.     There are currently only a few ways to put your laptop on a network.
  895.     You can use the SLIP code (and run at serial line speeds);
  896.     you can buy one of the few laptops that come with a NE2000-compatible
  897.     ethercard or PCMCIA slot built-in; you can get a laptop with a
  898.     docking station and plug in an ISA ethercard; or you can use a
  899.     parallel port Ethernet adapter such as the D-Link DE-600.
  900.  
  901. 7.01 Option 1 -- using SLIP
  902.  
  903.     This is the cheapest solution, but by far the most difficult. Also,
  904.     you will not get very high transmission rates. Since SLIP is not
  905.     really related to ethernet cards, it will not be discussed further
  906.     here. See the NET-2 HOWTO.
  907.  
  908. 7.02 Option 2 -- Built in NE2000 compatible or PCMCIA Ethercard.
  909.  
  910.     The second solution severely limits your laptop choices and is fairly
  911.     expensive. Be sure to read the specifications carefully, you may find
  912.     that you will have to buy an additional non-standard transceiver to
  913.     actually put the machine on a network.
  914.  
  915.     As this area of Linux development is fairly young, I'd suggest
  916.     that you join the LAPTOPS mailing channel. See section 0.02
  917.     which describes how to join a mailing list channel. Try and
  918.     determine exactly what hardware you have (ie. card manufacturer,
  919.     PCMCIA chip controller manufacturer) and then ask on the LAPTOPS
  920.     channel. Regardless, don't expect things to be all that simple.
  921.     Expect to have to fiddle around a bit, and patch kernels, etc.
  922.     Maybe someday you will be able to type "make config" 8-)
  923.  
  924.     There is a number of programs on tsx-11.mit.edu in
  925.     /pub/linux/packages/laptops/ that you may find useful. These
  926.     range from PCMCIA Ethercard drivers to programs that communicate
  927.     with the PCMCIA controller chip. Note that these drivers are
  928.     usually tied to a specific PCMCIA chip (ie. the intel 82365
  929.     or the TCIC/2) On a brighter note, I know that people have used the
  930.     Linksys/D-Link 650 PCMCIA Ethernet PC Card with both controller
  931.     chipsets, so it *can* be done. I have also seen reports of
  932.     people using the IBM Credit Card Adapter for Ethernet with the
  933.     intel 82365 chip. This is all just from following the LAPTOPS
  934.     channel.
  935.  
  936.     The 3c589 from 3Com is supposed to look a lot like a 3c509.
  937.  
  938.     Anyway, the PCMCIA driver problem isn't specific to the Linux world.
  939.     It's been a real disaster in the MS-DOS world. In that world
  940.     people expect the hardware to work if they just follow the manual.
  941.     They might not expect it to interoperate with any other hardware
  942.     or software, or operate optimally, but they do expect that the
  943.     software shipped with the product will function. Many PCMCIA
  944.     adaptors don't pass this test.
  945.  
  946. 7.03 Option 3 -- ISA Ethercard in the Docking Station.
  947.  
  948.     I recommend the third solution. Docking stations for laptops typically
  949.     cost about $250 and provide two full-size ISA slots, two serial and one
  950.     parallel port. Most (all?) docking stations are powered off of the
  951.     laptop's batteries, and a few allow adding extra batteries in the
  952.     docking station if you use short ISA cards. You can add an inexpensive
  953.     ethercard and enjoy full-speed ethernet performance.
  954.  
  955. 7.04 Option 4 -- Pocket / parallel port adaptors.
  956.  
  957.     The "pocket" ethernet adaptors may also fit your need.
  958.     Until recently they actually costed more than a docking station and
  959.     cheap ethercard, and most tie you down with a wall-brick power supply.
  960.     At present, you can choose from the D-Link, or the RealTek adaptor.
  961.     Most other companies, especially Xircom, treat the programming
  962.     information as a trade secret, so support will likely be slow in
  963.     coming.
  964.  
  965.     You can sometimes avoid the wall-brick with the adaptors by buying
  966.     or making a cable that draws power from the laptop's keyboard
  967.     port. (This is mentioned in the info. for the AT-Lan-Tec unit.)
  968.  
  969.     The keyboard pinouts (5 pin DIN) are as follows:
  970.  
  971.         Signal/Function            Pin #
  972.         ---------------            -----
  973.         KEYCLK (clock)            1
  974.         KEYDAT (data)            2
  975.         N/C                3
  976.         Ground                4
  977.         +5 V                5
  978.  
  979.     A quick check with a voltmeter will verify which pins are 4 and 5
  980.     if you are not sure.
  981. 8 Frequently asked questions
  982.  
  983.     Here are some of the more frequently asked questions about using
  984.     Linux with an Ethernet connection. Some of the more specific
  985.     questions are sorted on a "per manufacturer basis" and are listed
  986.     in the "Troubleshooting" section. (section 6). However, since this
  987.     document is basically "old" by the time you get it, any "new" problems
  988.     will not appear here instantly. For these, I suggest that you make
  989.     efficient use of your newsreader. For example, nn users would type
  990.         nn -xX -s'3c'
  991.     to get all the news articles in your subscribed list that have
  992.     "3c" in the subject. (ie. 3com, 3c509, 3c503, etc.)
  993.     The moral: Read the man page for your newsreader.
  994.     
  995. 8.01 Just the FAQ's ma'am -- just the FAQ's.
  996.  
  997.     Q: I heard that there is an alpha driver available for my card.
  998.        Where can I get it?
  999.  
  1000.     A: Assuming that it is a djb driver, it will be on ftp.super.org
  1001.        in the /pub/linux/ area. Things change here quite frequently,
  1002.        so just look around for it. There is usually only about 3
  1003.        subdirs, so you should be able to find it. Now, if it really
  1004.        is an alpha, or pre-alpha driver, then please treat it as
  1005.        such. In other words, don't complain because you can't figure
  1006.        out what to do with it. If you can't figure out how to install
  1007.        it, then you probably shouldn't be testing it. Also, if it brings
  1008.        your machine down, don't complain. Instead, send us a well
  1009.        documented bug report, or even better, a patch!
  1010.  
  1011.     Q: Is there token ring support for Linux?
  1012.  
  1013.     A: No, there is no token ring support in Linux. To support token ring
  1014.        requires more than only a writing a device driver, it also requires
  1015.        writing the source routing routines for token ring. Given that
  1016.        token ring is expensive, not fast, and will probably be swept away
  1017.        by 100baseVG in a few months, it doesn't seem worth it to write
  1018.        a driver. In case anyone wants to, I looked at writing a token ring
  1019.        device driver, and concluded that the hardware interface
  1020.        wasn't too difficult to do, but writing the support for source
  1021.        routing would take significantly longer than I was willing to spend
  1022.        on an expensive and dying technology.
  1023.  
  1024.        Alan Cox adds: "It will require [...] changes to the bottom socket
  1025.        layer to support 802.2 and 802.2 based TCP/IP. Don't expect
  1026.        anything soon."
  1027.  
  1028.     Q: Is there FDDI support for Linux?
  1029.  
  1030.     A: No, there is no Linux driver for any FDDI boards. I come from a
  1031.        place with supercomputers, so an external observer might think
  1032.        FDDI would be high on my list. But FDDI never delivered end-to-end
  1033.        throughput that would justify its cost, and it seems to be a nearly
  1034.        abandoned technology now that 100base{X,Anynet} seems imminent.
  1035.        (And yes, I know you can now get FDDI boards for <$1K. That
  1036.        seems to be a last-ditch effort to get some return on the
  1037.        development investment. Where is the next generation of FDDI
  1038.        going to come from?)
  1039.  
  1040.     Q: Can I link 10BaseT (RJ45) based systems together without a hub?
  1041.  
  1042.     A: You can link 2 machines easily, but no more than that, without
  1043.        extra devices/gizmos. See section 4 on wiring -- it explains
  1044.        how to do it. And no, you can't hack together a hub just by
  1045.        crossing a few wires and stuff. It's pretty much impossible 
  1046.        to do the collision signal right without duplicating a hub.
  1047.  
  1048.     Q: Is there IPX or Novell support available for Linux?
  1049.  
  1050.     A: Alan Cox writes: "The novell protocols are available from novell
  1051.        for various amounts. IPX is freely documented. SPX is about $1000
  1052.        but I'm told Xerox SPP is identical. _PLEASE_ has anyone got any
  1053.        freely distributable Xerox SPP code/documentation? The novell
  1054.        server spec costs you $15000 + royalties providing you only
  1055.        want to write a client, or $30000 + royalties otherwise. Needless
  1056.        to say the final output has to be binary only and subject to a
  1057.        novell license. Reading their license rules by my interpretation
  1058.        its also impossible for us to do because you would seem to have
  1059.        to bar disassembly of your final result, which is not allowed
  1060.        in the EEC.
  1061.  
  1062.        Bits of NCP are known, and I hope eventually enough will be known
  1063.        to write limited NCP support into Linux, for the moment I'm poking
  1064.        around at IPX, tho this will have to wait until the new network
  1065.        code is finished.
  1066.  
  1067.        An Alpha test IPX protocol layer is available from me (Alan)
  1068.        for pl14 or higher. People are also exploring the issue of NCP and
  1069.        the new Dr Dobbs journal article on the innards of netware has
  1070.        provided a core of good information."
  1071.  
  1072.        As an alternative, Miquel van Smoorenburg suggests the following:
  1073.        "It _is_ possible to set up a dedicated PC running both novell and
  1074.        the PD SOSS server and let it gateway from NFS to novell. This way
  1075.        it is possible to mount the Novell drives on the Unix client.
  1076.  
  1077.        SOSS is a PD (perhaps with some restrictions, but freely available)
  1078.        NFS server for DOS. It includes the PC/IP TCP/IP implementation
  1079.        and runs on a packet driver. I have run both a Novell client
  1080.        (with PDIPX, a Packet Driver IPX) and this SOSS server together
  1081.        successfully."
  1082.  
  1083.        You can get "Stan's Own Server System" from the following location:
  1084.         hilbert.wharton.upenn.edu:pub/tcpip/soss.zip
  1085.        Note that this version has the IP bugs fixed and the subdirs
  1086.        with extensions bug fixed. Some of the soss.zoo archives do
  1087.        not contain these fixes.
  1088.  
  1089.     Q: What needs to be done so that Linux can run two ethernet cards?
  1090.  
  1091.     A: The easiest solution is to get 0.99pl13 or newer, as the hooks for
  1092.        multiple ethercards are all there.
  1093.        You can enable additional ethercards with LILO parameters such as:
  1094.  
  1095.         lilo: linux ether=5,0x300,0,1,eth0 ether=15,0x280,eth1
  1096.  
  1097.        These boot time arguments can be made permanent so that you
  1098.        don't have to re-enter them every time. See the LILO manual.
  1099.  
  1100.     Q: Okay, I can run 2 cards -- can I run Linux as a gateway 
  1101.        between two networks?
  1102.  
  1103.     A: This is really a question for the NET-HOWTO, but it is 
  1104.        answered here anyways: Charles Hedrick (aka Mr. Slip)
  1105.        had this to say:
  1106.  
  1107.        "Yes, however I'm a bit nervous about doing it. The problem isn't
  1108.        functionality -- there's IP forwarding code, and as far as I know,
  1109.        it works. Some people do use it. However routers need to be
  1110.        particularly careful to avoid creating network problems such as
  1111.        "meltdowns." The Linux IP layer doesn't have quite enough of these
  1112.        protective features. It will only cause trouble if other hosts on
  1113.        your network are misconfigured, and even then it probably won't
  1114.        cause much trouble (assuming that only systems actually acting as
  1115.        gateways are built with IP_FORWARD enabled). But I'd still rather
  1116.        use a router that met all of the requirements of the host and
  1117.        router requirements in the RFC's. (Note that not all other Unix
  1118.        implementations do either. I'm concerned about things like not
  1119.        sending ICMP responses to messages that arrive as media 
  1120.        broadcasts. 386BSD looks OK, but older BSD-based implementations
  1121.        often didn't do all of these checks.)
  1122.  
  1123.        It depends a lot on what the network is like and how critical it is.
  1124.        For a home setup with a couple of hosts, I see no problem at all.
  1125.        But I would not consider using Linux as a router on a large
  1126.        campus network at the moment. I still think that by release 1.0,
  1127.        Linux will be a reasonably well-behaved host. But I think use
  1128.        as a router in critical situations should wait until somebody
  1129.        has checked the ip and icmp modules for compliance with RFC 1009
  1130.        and a few other specs."
  1131.  
  1132.     Q: I have /dev/eth0 as a link to /dev/xxx. Is this right?
  1133.  
  1134.     A: Contrary to what you have heard, the files in /dev/* are not used.
  1135.        I originally thought that they might be an OK idea. I've since
  1136.        concluded that they won't work, at least in the documented form.
  1137.  
  1138.     Q: Should I disable trailers when I "ifconfig" my ethercard?
  1139.  
  1140.     A: You can't disable trailers, and you shouldn't want to.
  1141.        'Trailers' are a hack to avoid data copying in the
  1142.        networking layers. The idea was to use a trivial 
  1143.        fixed-size header of size 'H', put the variable-size header 
  1144.        info at the end of the packet, and allocate all packets
  1145.        'H' bytes before the start of a page. While it was a good
  1146.        idea, it turned out to not work well in practice.
  1147.        If someone suggests the use of '-trailers', note that it
  1148.        is the equivalent of sacrificial goats blood. It won't do
  1149.        anything to solve the problem, but if problem fixes itself then
  1150.        someone can claim deep magical knowledge.
  1151.  
  1152. 9 Miscellaneous.
  1153.  
  1154.     Any other associated stuff that didn't fit in anywhere else gets
  1155.     dumped here. It may not be relevant, and it may not be of general
  1156.     interest but it is here anyway.
  1157.  
  1158. 9.01 Bad Vendors
  1159.  
  1160.     #define SOAPBOX
  1161.  
  1162.     There used to be some horror stories here about dealings with
  1163.     Cabletron and Xircom. They were pretty ugly and gruesome.
  1164.     Basically these companies are the ethernet equivalent of
  1165.     what Diamond is to XFree86. They do not want to release
  1166.     vital information on low-level programming of their hardware.
  1167.     For something like Linux, where the source code for everything
  1168.     is out in the open, this makes their hardware difficult or
  1169.     impossible to use. However, like Diamond, when confronted
  1170.     with the fact that they are losing sales from Linux/BSD users,
  1171.     they basically shrug it off, saying that it is only a small
  1172.     percentage of the total sales. If you can afford the time,
  1173.     drop these vendors a note (via e-mail or snail-mail) and tell
  1174.     them politely that the fact that they don't support open
  1175.     software systems such as Linux has forced you to exclude them
  1176.     from the vendors that you are purchasing hardware from. It may
  1177.     not make any immediate difference, but it might make you feel
  1178.     better. Besides, a few seconds of your time is a cheap price
  1179.     to pay for *all* that free Linux software you are using. 8-)
  1180.  
  1181.     #undef SOAPBOX
  1182.  
  1183. 9.02 Closing
  1184.  
  1185.     If you have found any glaring typos, or outdated info in this
  1186.     document, please let one of us know. It's getting big, and it
  1187.     is easy to overlook stuff.
  1188.  
  1189.     Paul Gortmaker        <gpg109@rsphy1.anu.edu.au>
  1190.     Donald J. Becker    <becker@super.org>
  1191.  
  1192.         =========== end of Ethernet HOWTO ============
  1193.  
  1194.